#!/usr/bin/env node


var program = require('commander');

program
  .version('0.0.0')
  .option('-s, --selector [string]', 'The CSS selector to attach to', String)
  .option('-e, --event [string]', 'The DOM event to attach', String)
  .option('-u, --url [string]', 'The url to connect to', String)
  // .option('-h, --host [host]', 'Specify listening host')

program.parse(process.argv);

  var opts = {
    selector: program.selector || "",
    event: program.event || "",
    url: program.url || "default",
    uri: ""
  };

if (typeof program.args[0]  !== "undefined"){
  opts.uri = "ws://" + program.args[0];
} else {
  opts.uri = "ws://localhost:8001";
}

var client = require('../lib/client');

client.connect(opts, function(){});
